package com.yy.wga.merchant.service.controller;

import com.yy.wga.common.core.dto.Result;
import com.yy.wga.common.util.mapping.BeansUtils;
import com.yy.wga.merchant.feign.api.MerchantInfoFeign;
import com.yy.wga.merchant.feign.response.MerchantMpConfigInfoResp;
import com.yy.wga.merchant.service.pojo.MerchantInfoDO;
import com.yy.wga.merchant.service.service.MerchantInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 商户信息
 *
 * @author guochao
 * @since 2024-10-31 22:12:53
 */
@Component
public class MerchantInfoController implements MerchantInfoFeign {
    @Resource
    private MerchantInfoService merchantInfoService;

    @Override
    public Result<List<MerchantMpConfigInfoResp>> list() {
        List<MerchantInfoDO> merchantInfoList = merchantInfoService.list();
        return Result.success(BeansUtils.mapList(merchantInfoList, MerchantMpConfigInfoResp.class));
    }
}
